package net.sansi.v3correctserver.dto.v3serverapi;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import net.sansi.v3correctserver.dto.correctresult.CorrectResultDto;

import java.util.List;

/**
 * v3 服务器返回的 Correct 校正数据
 */
public class V3ServerCorrectDto {

    @Getter
    @Setter
    public static class HardwarePreviewEnable {
        private Boolean enable;
    }

    @Getter
    @Setter
    public static class HardwarePreviewDisplayReq {

        @Setter
        @Getter
        public static class AreaInfo {
            @JsonProperty("xStart")
            private Integer xStart;
            @JsonProperty("yStart")
            private Integer yStart;
            @JsonProperty("xShowW")
            private Integer xShowW;
            @JsonProperty("yShowH")
            private Integer yShowH;
        }

        @Setter
        @Getter
        public static class SplitInfo {
            @JsonProperty("xSplitNum")
            private Integer xSplitNum;
            @JsonProperty("ySplitNum")
            private Integer ySplitNum;
            @JsonProperty("xOffset")
            private Integer xOffset;
            @JsonProperty("yOffset")
            private Integer yOffset;
        }

        @Setter
        @Getter
        public static class Color {
            private Integer red;
            private Integer green;
            private Integer blue;
        }

        private AreaInfo areaInfo;
        private SplitInfo splitInfo;
        private Color color;
    }

    @Getter
    @Setter
    public static class HardwarePreviewResp {
        private String status;
    }

    @Data
    public static class UploadCLResp {
        private String status;
    }

    @Data
    public static class UploadCFResp {
        private String status;
    }

    @Data
    public static class UpgradeProgressResp {

        ScreenProgress screenProgress;

        @Data
        public static class ScreenProgress {
            private String status;
            private Integer progress;
        }
    }

    @Data
    public static class StartSolidifyFactorReq {
        @ApiModelProperty("数据类型: BCORR, BLCORR")
        private String dataType;

        @ApiModelProperty("操作类型: RAM_TO_FLASH = 1\n" +
                "FLASH_TO_PANEL = 2\n" +
                "FLASH_TO_RAM = 3\n" +
                "PANEL_TO_RAM = 4")
        private Integer action;

        private List<Scanner> scannerArr;

        @Data
        public static class Scanner {
            private String id;
            private String name;
            private Integer type;
        }
    }

    @Data
    public static class SolidifyProgressResp {

        ScreenProgress screenProgress;

        @Data
        public static class ScreenProgress {
            private String status;
            private Integer progress;
            private String actionName;
            private Integer action;
        }
    }
}
